// class CustomeError extends Error{
//     constructor(message){
//         super(message);
//         this.name = 'CustomeError';
//         this.message = message;
//     }
// }
// try{
//     throw new CustomeError('hello world');
// }catch(e){
//     console.log(e.name);
//     console.log(e.message);
// }

function process(values){
    if(!(values instanceof Array)){
        throw new Error("process(): Argument must be an array.");
    }
    values.sort();
    for(const value of values){
        if(value > 100){
            return value;
        }
    }
    return -1;
}
const arr1 = [1,2,45.34,23,56,12,78];
const arr2 = "abcdef"
const arr3 = [1,6,2,67,34,567,234,123,109]
try{
    console.log(process(arr1));
    console.log(process(arr3));
    console.log(process(arr2));
}catch(e){
    console.log(e);
}